import requests

# 新增员工请求发送 需要令牌 令牌从登录那里获取
url = "http://ihrm-test.itheima.net/api/sys/user"
headers = {"Authorization": "Bearer 25f2b9fd-543d-4702-acf4-281f64f29d68"}
body = {"username": "YG009","mobile": "15022235698","workNumber": "123"}
resp=requests.post(url,headers=headers,json=body)

print(resp.status_code)
print(resp.json())

# 修改和删除员工
url = "http://ihrm-test.itheima.net/api/sys/user/1530822023771652096"
headers = {"Authorization": "Bearer 25f2b9fd-543d-4702-acf4-281f64f29d68"}
body = {"username": "YG002","password": "123456","departmentId": "10086"}
resp1=requests.put(url,headers=headers,json=body)

print(resp1.status_code)
print(resp1.json())

# 删除员工
resp2=requests.delete(url,headers=headers)

print(resp1.status_code)
print(resp1.json())